Skip to content

Add Python SDK support for new lifecycle event types#206

Open
eddie-lee-msft wants to merge 2 commits intomainfrom
user/edle/NewLifecycleEventsInPython
Open

Add Python SDK support for new lifecycle event types#206
eddie-lee-msft wants to merge 2 commits intomainfrom
user/edle/NewLifecycleEventsInPython

Conversation

@eddie-lee-msft
Copy link
Copy Markdown

Add Python SDK support for new lifecycle event types

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new agent lifecycle event types to the microsoft-agents-a365-notifications package so applications can register handlers for additional user lifecycle notifications.

Changes:

  • Updated AgentLifecycleEvent enum values to align with new/updated lifecycle event type identifiers.
  • Added new convenience decorators on AgentNotification for user undeleted/updated/manager-updated lifecycle events.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/models/agent_lifecycle_event.py Extends/updates lifecycle event enum values to represent newly supported lifecycle event types.
libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py Adds new on_user_* decorators for registering handlers for the new lifecycle event types.

Comment on lines 21 to +23
USERWORKLOADONBOARDINGUPDATED = "agenticuserworkloadonboardingupdated"
USERDELETED = "agenticuseridentitydeleted"
USERDELETED = "agenticuserdeleted"
USERUNDELETED = "agenticuserundeleted"
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the string value of the existing AgentLifecycleEvent.USERDELETED enum member from the previous value is a breaking change for consumers who persisted/compared against the old event type. If both event types can still be observed, consider keeping the old value as a deprecated alias/additional enum member (and/or accepting both in routing) to preserve backward compatibility.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not correct in the first place. .NET and NodeJS SDKs have the right value.

Comment on lines +449 to +450
"""
return self.on_lifecycle_notification(AgentLifecycleEvent.USERUNDELETED, **kwargs)
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on_user_undeleted returns self.on_lifecycle_notification(...), but AgentNotification doesn’t define an on_lifecycle_notification method anywhere in this module (only on_agent_lifecycle_notification). This will raise AttributeError when the decorator is used. Either implement on_lifecycle_notification (possibly as an alias/wrapper) or update these convenience methods to call the correct existing lifecycle registration method.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not quite sure why this comment was generated, there are existing "on_..." methods that call self.on_lifecycle_notification(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants